package com.lostandfound.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**  
* 
*  
* @date 2018年3月14日
*/
@Entity
@Table(name = "laf_reply_t")
public class Reply implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private Long rid;//ID
	private String rcontent;//内容
	private Date r_create_time;//发布时间
	private String rstatus = "0";//0正常，1删除
	private User user;//所属用户
	private Topic topic;//所属帖子
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY) 
    @Column(name = "r_id", unique = true, nullable = false, length = 8)
	public Long getRid() {
		return rid;
	}
	public void setRid(Long rid) {
		this.rid = rid;
	}
	
	@Column(name = "r_content",nullable = false, length = 200)
	public String getRcontent() {
		return rcontent;
	}
	public void setRcontent(String rcontent) {
		this.rcontent = rcontent;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "r_create_time", length = 7)
	public Date getR_create_time() {
		return r_create_time;
	}
	public void setR_create_time(Date r_create_time) {
		this.r_create_time = r_create_time;
	}
	
	@Column(name = "r_status",nullable = false, length = 1)
	public String getRstatus() {
		return rstatus;
	}
	public void setRstatus(String rstatus) {
		this.rstatus = rstatus;
	}
	
	@ManyToOne
	@JoinColumn(name="id")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
	@ManyToOne
	@JoinColumn(name="tid")
	public Topic getTopic() {
		return topic;
	}
	public void setTopic(Topic topic) {
		this.topic = topic;
	}
	
}
